package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MedicineRegisterMapper;
import com.ruoyi.system.domain.MedicineRegister;
import com.ruoyi.system.service.IMedicineRegisterService;

/**
 * 中药登记Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-23
 */
@Service
public class MedicineRegisterServiceImpl implements IMedicineRegisterService 
{
    @Autowired
    private MedicineRegisterMapper medicineRegisterMapper;

    /**
     * 查询中药登记
     * 
     * @param id 中药登记主键
     * @return 中药登记
     */
    @Override
    public MedicineRegister selectMedicineRegisterById(Long id)
    {
        return medicineRegisterMapper.selectMedicineRegisterById(id);
    }

    /**
     * 查询中药登记列表
     * 
     * @param medicineRegister 中药登记
     * @return 中药登记
     */
    @Override
    public List<MedicineRegister> selectMedicineRegisterList(MedicineRegister medicineRegister)
    {
        return medicineRegisterMapper.selectMedicineRegisterList(medicineRegister);
    }

    /**
     * 新增中药登记
     * 
     * @param medicineRegister 中药登记
     * @return 结果
     */
    @Override
    public int insertMedicineRegister(MedicineRegister medicineRegister)
    {
        medicineRegister.setCreateTime(DateUtils.getNowDate());
        return medicineRegisterMapper.insertMedicineRegister(medicineRegister);
    }

    /**
     * 修改中药登记
     * 
     * @param medicineRegister 中药登记
     * @return 结果
     */
    @Override
    public int updateMedicineRegister(MedicineRegister medicineRegister)
    {
        medicineRegister.setUpdateTime(DateUtils.getNowDate());
        return medicineRegisterMapper.updateMedicineRegister(medicineRegister);
    }

    /**
     * 批量删除中药登记
     * 
     * @param ids 需要删除的中药登记主键
     * @return 结果
     */
    @Override
    public int deleteMedicineRegisterByIds(Long[] ids)
    {
        return medicineRegisterMapper.deleteMedicineRegisterByIds(ids);
    }

    /**
     * 删除中药登记信息
     * 
     * @param id 中药登记主键
     * @return 结果
     */
    @Override
    public int deleteMedicineRegisterById(Long id)
    {
        return medicineRegisterMapper.deleteMedicineRegisterById(id);
    }
}
